# coding=utf-8
# @Time    : 2018/3/5 11:26
# @Author  : Jiangxu
# @File    : IO编程.py
# @Software: PyCharm
import  os
# try:
#     f = open('/jiangxu/PycharmProjects/python-test/test.txt', 'r')
#     print f.read()
# finally:
#     if f:
#         f.close()
#
# # f = open('/jiangxu/PycharmProjects/python-test/test.txt', 'w')
# # f.write('Hello Python')
# # f.close()
#
#
# with open('/jiangxu/PycharmProjects/python-test/test.txt', 'a') as f:
#     f.write('Hello Python')
#     f.write('\n')
#
# with open('/jiangxu/PycharmProjects/python-test/test.txt', 'r') as f:
# # 	for line in f.readlines():
# # 		print(line.strip())
#     print f.read()

# print os.environ
# print os.getenv('PATH')

print os.path.abspath('.')
# os.path.join('/jiangxu/PycharmProjects/python-test','io')
# os.mkdir('/jiangxu/PycharmProjects/python-test/io')
#os.rmdir('/jiangxu/PycharmProjects/python-test/io')
print [x for x in os.listdir('.') if os.path.isfile(x) and os.path.splitext(x)[1]=='.py']

